import { request } from './index.js';

// 获取视频列表
export function getVideoList(page = 1, size = 1) {
  return request({
    url: '/Video/api/video/getVideoList',
    method: 'GET',
    data: { page, size }
  });
}

// 获取视频详情
export function getVideoDetail(videoId) {
  return request({
    url: '/Video/api/video/getVideoDetail',
    method: 'GET',
    data: { videoId }
  });
}

// 获取视频评论
export function getVideoComments(videoId) {
  return request({
    url: '/Video/api/video/getVideoComments',
    method: 'GET',
    data: { videoId }
  });
}

// 添加评论
export function addVideoComment(videoId, userId, comment, parentId = null) {
  return request({
    url: '/Video/api/video/addComment',
    method: 'POST',
    data: { videoId, userId, comment, parentId }
  });
}

// 点赞/取消点赞视频
export function likeVideo(videoId, userId, isLike) {
  return request({
    url: '/Video/api/video/likeVideo',
    method: 'POST',
    data: { videoId, userId, isLike }
  });
}

// 点赞/取消点赞评论
export function likeComment(commentId, userId, isLike) {
  return request({
    url: '/Video/api/video/likeComment',
    method: 'POST',
    data: { commentId, userId, isLike }
  });
} 